package com.doubao.doubao.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.doubao.doubao.mapper.BmsNewGroupMapper;
import com.doubao.doubao.model.entity.BmsNewGroup;
import com.doubao.doubao.model.vo.JoinGroupVO;
import com.doubao.doubao.service.IBmsNewGroupervice;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;


@Service
public class IBmsNewGropuImpl extends ServiceImpl<BmsNewGroupMapper, BmsNewGroup> implements IBmsNewGroupervice {
    public BmsNewGroup getGroupLeader(String groupId) {
        return baseMapper.selectOne(new LambdaQueryWrapper<BmsNewGroup>().eq(BmsNewGroup::getGroupId, groupId));
    }

//    public BmsNewGroup JoinGroup(String groupId) {
//        return baseMapper.selectOne(new LambdaQueryWrapper<BmsNewGroup>().eq(BmsNewGroup::getGroupId, groupId));
//    }

    public List<JoinGroupVO> getJoinMenu(String userid) {
        List<JoinGroupVO> lstjoinGroup = new ArrayList<JoinGroupVO>();
        try {
            lstjoinGroup = this.baseMapper.getJoinMenu(userid);
        } catch (Exception e) {
            log.error("lstJoinGroup失败");
        }
        return lstjoinGroup;
    }

}
